home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Hyper / S / ShortStack.sit / ShortStack / card_4857.txt < prev    next >
Encoding:
Text File  |  1994-10-07  |  2.9 KB  |  81 lines

  1. -- card: 4857 from stack: in
  2. -- bmap block id: 5119
  3. -- flags: 0000
  4. -- background id: 3650
  5. -- name: ardset the scroll of card field 1 to 1end closeCard
  6.  
  7.  
  8. -- part 4 (field)
  9. -- low flags: 05
  10. -- high flags: 0007
  11. -- rect: left=52 top=61 right=241 bottom=455
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 3
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Explanation
  20.  
  21.  
  22. -- part 5 (button)
  23. -- low flags: 00
  24. -- high flags: A003
  25. -- rect: left=111 top=262 right=284 bottom=211
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: Next Card
  34. ----- HyperTalk script -----
  35. on mouseUp
  36.   go to card id 2671
  37. end mouseUp
  38.  
  39.  
  40. -- part 6 (button)
  41. -- low flags: 00
  42. -- high flags: A003
  43. -- rect: left=266 top=263 right=285 bottom=366
  44. -- title width / last selected line: 0
  45. -- icon id / first selected line: 0 / 0
  46. -- text alignment: 1
  47. -- font id: 0
  48. -- text size: 12
  49. -- style flags: 0
  50. -- line height: 16
  51. -- part name: Look at Data
  52. ----- HyperTalk script -----
  53. on mouseUp
  54.   go to card id 3931
  55. end mouseUp
  56.  
  57.  
  58. -- part contents for card part 4
  59. -- note: style data is present
  60. ----- text -----
  61. Rather than have a separate card for each possible set of data to be displayed, it is more efficient (not to mention ELEGANT) HyperCard scripting to use a single card to hold all the data and then build each individual "card" on-the-fly, or, in other words: virtual cards!
  62.  
  63. In this way, ShortStack contains only three cards, but gives the impression of containing as many as 18 cards.
  64.  
  65. Go to the next card and click on the "Answer" button.  Each time you click, instead of bringing up another card with the same background and card fields, you see different data supplied for the field.  The same effect could be achieved by having a different card for each answer, but this method uses much less overhead and makes it much easier to add and maintain data (since it's all in one spot, there's only one card to edit).
  66.  
  67. The answers (the data) are all contained on a single card, Card Three of this stack.  Click on the "Look at Data" button to go to this card.  Notice that commas separate the line number from the line data.
  68.  
  69. The script that does the building of the on-the-fly "card" is in the "Answer" button.  Check it out!  (Choose the Button Tool, double click on the "Answer" button and click on "script.")
  70. There are five variations, which should give you plenty of food for thought.
  71. Although all the examples use only one or two lines from the Data Card, many different elements can be used to build up a more complicated virtual card.
  72.  
  73. Best of luck!
  74.  
  75. This stack is freeware:  free to use, free to share (but also free of all liability for the author!).  
  76.  
  77. Compliments, however, are always welcome and may be directed to:
  78. Stuart Kohler, <skohler@aol.com>
  79.  
  80. (And a tip-of-the-hat to Ken Dufort who is virtually responsible for this stack!)
  81.